<template>
    <div>
        <h1>组件全局定义</h1>
        <div :style="{ fontSize: postFontSize + 'em' }">
            <BlogPost title="单击我缩小DIV字体" @enlarge-text="postFontSize -= 0.1" />
            <BlogPost title="单击我放大DIV字体" @enlarge-text="postFontSize += 0.1" />
        </div>
    </div>
</template>

<script>
import { ref } from 'vue'
export default {
    setup() {
        const postFontSize = ref(1)
        return { postFontSize }
    },
}
</script>

<!-- vue3高级写法 -->
<!-- <script setup>
    import { ref } from 'vue'
    const postFontSize = ref(1)
</script> -->